Integrand size = 41, antiderivative size = 240 \[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 (3 b B+a C) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (3 A b^2-\left (a^2-b^2\right ) C\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b d \sqrt {a+b \cos (c+d x)}}+\frac {2 a A \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticPi}\left (2,\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{d \sqrt {a+b \cos (c+d x)}}+\frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d} \]
[Out]
Time = 0.78 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {3128, 3138, 2734, 2732, 3081, 2742, 2740, 2886, 2884} \[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 \left (3 A b^2-C \left (a^2-b^2\right )\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b d \sqrt {a+b \cos (c+d x)}}+\frac {2 a A \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticPi}\left (2,\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{d \sqrt {a+b \cos (c+d x)}}+\frac {2 (a C+3 b B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d} \]
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2884
Rule 2886
Rule 3081
Rule 3128
Rule 3138
Rubi steps \begin{align*} \text {integral}& = \frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d}+\frac {2}{3} \int \frac {\left (\frac {3 a A}{2}+\frac {1}{2} (3 A b+3 a B+b C) \cos (c+d x)+\frac {1}{2} (3 b B+a C) \cos ^2(c+d x)\right ) \sec (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx \\ & = \frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d}-\frac {2 \int \frac {\left (-\frac {3}{2} a A b-\frac {1}{2} \left (3 A b^2-\left (a^2-b^2\right ) C\right ) \cos (c+d x)\right ) \sec (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{3 b}+\frac {(3 b B+a C) \int \sqrt {a+b \cos (c+d x)} \, dx}{3 b} \\ & = \frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d}+(a A) \int \frac {\sec (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx-\frac {\left (-3 A b^2+\left (a^2-b^2\right ) C\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{3 b}+\frac {\left ((3 b B+a C) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{3 b \sqrt {\frac {a+b \cos (c+d x)}{a+b}}} \\ & = \frac {2 (3 b B+a C) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d}+\frac {\left (a A \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {\sec (c+d x)}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{\sqrt {a+b \cos (c+d x)}}-\frac {\left (\left (-3 A b^2+\left (a^2-b^2\right ) C\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{3 b \sqrt {a+b \cos (c+d x)}} \\ & = \frac {2 (3 b B+a C) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (3 A b^2-\left (a^2-b^2\right ) C\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b d \sqrt {a+b \cos (c+d x)}}+\frac {2 a A \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticPi}\left (2,\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{d \sqrt {a+b \cos (c+d x)}}+\frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 4.37 (sec) , antiderivative size = 393, normalized size of antiderivative = 1.64 \[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {\frac {4 (3 A b+3 a B+b C) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{\sqrt {a+b \cos (c+d x)}}+\frac {2 (3 b B+a (6 A+C)) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticPi}\left (2,\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{\sqrt {a+b \cos (c+d x)}}+\frac {2 i (3 b B+a C) \sqrt {-\frac {b (-1+\cos (c+d x))}{a+b}} \sqrt {\frac {b (1+\cos (c+d x))}{-a+b}} \csc (c+d x) \left (-2 a (a-b) E\left (i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \cos (c+d x)}\right )|\frac {a+b}{a-b}\right )+b \left (-2 a \operatorname {EllipticF}\left (i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \cos (c+d x)}\right ),\frac {a+b}{a-b}\right )+b \operatorname {EllipticPi}\left (\frac {a+b}{a},i \text {arcsinh}\left (\sqrt {-\frac {1}{a+b}} \sqrt {a+b \cos (c+d x)}\right ),\frac {a+b}{a-b}\right )\right )\right )}{a b^2 \sqrt {-\frac {1}{a+b}}}+4 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{6 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(739\) vs. \(2(307)=614\).
Time = 5.31 (sec) , antiderivative size = 740, normalized size of antiderivative = 3.08
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (4 C \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+3 A \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )-3 a A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \Pi \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), 2, \sqrt {-\frac {2 b}{a -b}}\right ) b +3 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -3 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) b^{2}+2 C \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -6 C \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}+C \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}-C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -2 C a b \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+2 C \,b^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 b \sqrt {-2 b \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b}\, d}\) | \(740\) |
parts | \(\text {Expression too large to display}\) | \(818\) |
[In]
[Out]
Timed out. \[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \sqrt {a + b \cos {\left (c + d x \right )}} \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sec \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sec \left (d x + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \sqrt {a+b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \frac {\sqrt {a+b\,\cos \left (c+d\,x\right )}\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right )}{\cos \left (c+d\,x\right )} \,d x \]
[In]
[Out]